layui.use('form', function() {
	var form = layui.form;
	
	//自定义验证规则
	form.verify({
		sConten : function(value) {
			if (value.length == "") {
				return '请输入客服账号';
			}
		}
	});
	
	//监听提交
	form.on('submit(formDemo)', function(data) {
		$.post("handinOnlieServiceSetting.do", {
			sId: $("#sId").val(),
			sConten: $("#sConten").val()
		}, function(res){
			res = JSON.parse(res);
			if(res.type == 1) {
				layer.msg("保存成功！");
				setTimeout(function(){
					location.reload();
				}, 1000);
			} else {
				layer.msg("操作失败，请稍后重试！");
			}
		})
		return false;
	});
});